<!--
 * @FilePath     : /study_code/layui/13-2-2.html
 * @Description  : table options width
 * @Date         : 2025-04-07 17:15:21
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-07 17:56:16
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <table id="demo" lay-filter="test"></table>

    <script src="/layui/dist/layui.js"></script>
    <script src="/layui/table/common.js"></script>
    <script>
      var table = layui.table

      table.render({
        elem: '#demo',
        cols: cols,
        data: tableData,
        /**
         * @key width
         * @brief: 设置容器（固定）宽度
         * @value {number} 一个数字宽度值
         * （默认）随父元素铺满
         * 【注意】
         * #内容超出固定宽度时，会自动出现横向滚动条。
         * '500px' 设置无效；
         */
        width: 500,
      })
    </script>
  </body>
</html>
